<?php
// Luu dieu kien loc theo linh vuc 
$v_current_item_id = '';
if(isset($_REQUEST['hdn_current_item_id'])){
	$v_current_item_id = $_REQUEST['hdn_current_item_id'];
}
$v_rcord_type_id = "";
if(isset($_REQUEST['hdn_record_type_id'])){
	$v_rcord_type_id = $_REQUEST['hdn_record_type_id'];
}
$v_receive_date_filter = "";
if(isset($_REQUEST['hdn_received_date_filter'])){
	$v_receive_date_filter = $_REQUEST['hdn_received_date_filter'];
} 
$v_recordtype_filter = "001";
if(isset($_REQUEST['hdn_recordtype_filter'])){
	$v_recordtype_filter = $_REQUEST['hdn_recordtype_filter'];
}  
$v_staff_id = $_SESSION['staff_id'];
$v_status = "";
$v_status_of_handover = -10;
$v_status_of_assigning = -10;
$v_status_of_handle_approve = -10;
$v_status_of_chaiman_approve = -10;
$v_order_clause = "ORDER BY C_RECEIVED_DATE DESC";
if(_is_sqlserver()){
	$sql = "Exec Onegate_RecordGetAll";
	$sql = $sql . " " . $v_staff_id ;
	$sql = $sql . ",'" . $v_recordtype_filter . "'" ;
	$sql = $sql . ",'" ._ddmmyyyy_to_yyyymmdd($v_receive_date_filter) . "'" ;
	$sql = $sql . ",'" . $v_status."'" ;
	$sql = $sql . "," . $v_status_of_handover;
	$sql = $sql . "," . $v_status_of_assigning;
	$sql = $sql . "," . $v_status_of_handle_approve;
	$sql = $sql . "," . $v_status_of_chaiman_approve;
	$sql = $sql . ",'" . $v_order_clause."'" ;
	$ado_conn->SetFetchMode(ADODB_FETCH_ASSOC);
	$arr_all_record = $ado_conn->GetAll($sql);
	//echo $sql;
	//var_dump($arr_all_record);
}
?>